import axios from './network'

//    获得客户列表
function getClientList(){
  return axios({
    url:'customer/customer_list'
  })
}

//  获得代客下单选项列表
function getValetList(){
  return axios({
    url:'customer/customer_order_msg'
  })
}

//    获得客户详情
function getClientInfo(customer_id){
  return axios({
    url:"customer/customer_info",
    method: "POST",
    data:{
      customer_id
    }
  })
}

//    获得合同汇总
function getContractTotal(customer_id){
  return axios({
    url:"servicer/agreement",
    data:{
      customer_id
    }
  })
}

//    获得客户回款
function getClientBack(data){
  return axios({
    url:'orders/customer_back',
    method:'post',
    data:data
  })
}

//   业务员查看合同详情
function getContractDetail(agreement_id){
  return axios({
    url:'servicer/agreement_detail',
    method:"POST",
    data:{
      agreement_id
    }
  })
}

//     获得合同详细
function getAgreement(agreement_id){
  return axios({
    url:'orders/agreement',
    data:{
      agreement_id
    }
  })
}

//     获得合同页面已签合同
function getContractPass(){
  return axios({
    url:"servicer/agreement_pass"
  })
}

//     获得合同页面未签合同
function getContractCheck(){
  return axios({
    url:"servicer/agreement_check"
  })
}

//     获得合同基本信息
function getContractInfo(agreement_id){
  let data;
  if(agreement_id){
    data={
      agreement_id
    }
  }
  return axios({
    url:'customer/agreement',
    method:"POST",
    data
  })
}


//  发送代客下单订单信息
function sendOrderInfo(params){
  return axios({
    url:'customer/customer_order_add',
    method:"POST",
    data:params
  })
}

//    发送添加客户   
function sendAddClient(data){
  return axios({
    url:'servicer/customer_add',
    method:"POST",
    data:data
  })
}

//     发送上传合同
function sendUploadContract(data){
  return axios({
    url:'orders/upload_agreement',
    method:"POST",
    data:data
  })
}

//     发送编辑信息
function sendEditInfo(data){
  return axios({
    url:"customer/customer_update",
    method:"POST",
    data
  })
}
//     发送删除信息
function sendDeleteInfo(customer_id){
  return axios({
    url:"customer/customer_delete",
    method:"POST",
    data:{
      customer_id
    }
  })
}

//   发送添加合同
function sendAddContract(data){
  return axios({
    url:'customer/agreement_add',
    method:"POST",
    data
  })
}

export{
  getClientList,
  getValetList,
  getClientInfo,
  getContractTotal,
  getClientBack,
  getContractDetail,
  getAgreement,
  getContractPass,
  getContractCheck,
  getContractInfo,
  sendAddClient,
  sendUploadContract,
  sendEditInfo,
  sendOrderInfo,
  sendDeleteInfo,
  sendAddContract
}